home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / T / Think-Pascal-7.0.cpt / THINK Pascal Interfaces / TextEdit.p < prev    next >
Encoding:
Text File  |  1991-04-05  |  4.7 KB  |  130 lines  |  [TEXT/PJMM]

  1. {    This file has been processed by The THINK Pascal Source Converter, v1.1.    }
  2.  
  3. {}
  4. {Created: Sunday, January 6, 1991 at 11:23 PM}
  5. {    TextEdit.p}
  6. {    Pascal Interface to the Macintosh Libraries}
  7. {}
  8. {        Copyright Apple Computer, Inc.    1985-1990}
  9. {        All rights reserved}
  10. {}
  11.  
  12.  
  13.  
  14. {    RMS    4/3/91        Modified to exclude declarations already in the THINK Pascal built-in interfaces    }
  15.  
  16.  
  17.  
  18. unit TextEdit;
  19. interface
  20.     uses
  21.         Types, Quickdraw;
  22.  
  23.  
  24.     const
  25. { new names for the Justification styles }
  26.         teFlushDefault = 0;                     {flush according to the line direction }
  27.         teCenter = 1;                           {center justify }
  28.         teFlushRight = -1;                      {flush right for all scripts }
  29.         teFlushLeft = -2;                       {flush left for all scripts }
  30.  
  31. { Set/Replace style modes }
  32.         fontBit = 0;                            {set font}
  33.         faceBit = 1;                            {set face}
  34.         sizeBit = 2;                            {set size}
  35.         clrBit = 3;                             {set color}
  36.         addSizeBit = 4;                         {add size mode}
  37.         toglBit = 5;                            {set faces in toggle mode}
  38.  
  39. { offsets into TEDispatchRec }
  40.         EOLHook = 0;                            {[ProcPtr] TEEOLHook}
  41.         DRAWHook = 4;                           {[ProcPtr] TEWidthHook}
  42.         WIDTHHook = 8;                          {[ProcPtr] TEDrawHook}
  43.         HITTESTHook = 12;                       {[ProcPtr] TEHitTestHook}
  44.         nWIDTHHook = 24;                        {[ProcPtr] nTEWidthHook}
  45.         TextWidthHook = 28;                     {[ProcPtr] TETextWidthHook}
  46.  
  47. { selectors for TECustomHook }
  48.         intEOLHook = 0;                         {TEIntHook value}
  49.         intDrawHook = 1;                        {TEIntHook value}
  50.         intWidthHook = 2;                       {TEIntHook value}
  51.         intHitTestHook = 3;                     {TEIntHook value}
  52.         intNWidthHook = 6;                      {TEIntHook value for new version of WidthHook}
  53.         intTextWidthHook = 7;                   {TEIntHook value for new TextWidthHook}
  54.  
  55. { feature or bit definitions for TEFeatureFlag }
  56.         teFAutoScr = 0;                         {00000001b}
  57.         teFTextBuffering = 1;                   {00000010b}
  58.         teFOutlineHilite = 2;                   {00000100b}
  59.         teFInlineInput = 3;                     {00001000b}
  60.         teFUseTextServices = 4;                 {00010000b}
  61.  
  62. { action for the new "bit (un)set" interface, TEFeatureFlag }
  63.         TEBitClear = 0;
  64.         TEBitSet = 1;                           {set the selector bit}
  65.         TEBitTest = -1;                         {no change; just return the current setting}
  66.  
  67. {constants for identifying the routine that called FindWord }
  68.         teWordSelect = 4;                       {clickExpand to select word}
  69.         teWordDrag = 8;                         {clickExpand to drag new word}
  70.         teFromFind = 12;                        {FindLine called it ($0C)}
  71.         teFromRecal = 16;                       {RecalLines called it ($10)}
  72.  
  73.     type
  74.         TextStylePtr = ^TextStyle;
  75.         TextStyleHandle = ^TextStylePtr;
  76.  
  77.         TEIntHook = INTEGER;
  78.  
  79.     function TEGetPoint (offset: INTEGER; hTE: TEHandle): Point;
  80.     inline
  81.         $3F3C, $0008, $A83D;
  82.     function TEStylNew (destRect: Rect; viewRect: Rect): TEHandle;
  83.     inline
  84.         $A83E;
  85.     procedure SetStylHandle (theHandle: TEStyleHandle; hTE: TEHandle);
  86.     inline
  87.         $3F3C, $0005, $A83D;
  88.     function GetStylHandle (hTE: TEHandle): TEStyleHandle;
  89.     inline
  90.         $3F3C, $0004, $A83D;
  91.     procedure TEGetStyle (offset: INTEGER; var theStyle: TextStyle; var lineHeight: INTEGER; var fontAscent: INTEGER; hTE: TEHandle);
  92.     inline
  93.         $3F3C, $0003, $A83D;
  94.     procedure TEStylPaste (hTE: TEHandle);
  95.     inline
  96.         $3F3C, $0000, $A83D;
  97.     procedure TESetStyle (mode: INTEGER; newStyle: TextStyle; redraw: BOOLEAN; hTE: TEHandle);
  98.     inline
  99.         $3F3C, $0001, $A83D;
  100.     procedure TEReplaceStyle (mode: INTEGER; oldStyle: TextStyle; newStyle: TextStyle; redraw: BOOLEAN; hTE: TEHandle);
  101.     inline
  102.         $3F3C, $0002, $A83D;
  103.     function GetStylScrap (hTE: TEHandle): StScrpHandle;
  104.     inline
  105.         $3F3C, $0006, $A83D;
  106.     procedure TEStylInsert (text: Ptr; length: LONGINT; hST: StScrpHandle; hTE: TEHandle);
  107.     inline
  108.         $3F3C, $0007, $A83D;
  109.     function TEGetHeight (endLine: LONGINT; startLine: LONGINT; hTE: TEHandle): LONGINT;
  110.     inline
  111.         $3F3C, $0009, $A83D;
  112.     function TEContinuousStyle (var mode: INTEGER; var aStyle: TextStyle; hTE: TEHandle): BOOLEAN;
  113.     inline
  114.         $3F3C, $000A, $A83D;
  115.     procedure SetStylScrap (rangeStart: LONGINT; rangeEnd: LONGINT; newStyles: StScrpHandle; redraw: BOOLEAN; hTE: TEHandle);
  116.     inline
  117.         $3F3C, $000B, $A83D;
  118.     procedure TECustomHook (which: TEIntHook; var addr: ProcPtr; hTE: TEHandle);
  119.     inline
  120.         $3F3C, $000C, $A83D;
  121.     function TENumStyles (rangeStart: LONGINT; rangeEnd: LONGINT; hTE: TEHandle): LONGINT;
  122.     inline
  123.         $3F3C, $000D, $A83D;
  124.     function TEFeatureFlag (feature: INTEGER; action: INTEGER; hTE: TEHandle): INTEGER;
  125.     inline
  126.         $3F3C, $000E, $A83D;
  127.  
  128. implementation
  129. end.
  130.